package com.wzq.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wzq.bean.DataCollectionModel;
import com.wzq.bean.Result;
import com.wzq.service.DataCollectionService;
import com.wzq.util.ApiException;
import com.wzq.util.ApiResponse;
import com.wzq.util.Pager;
import com.wzq.util.ResponseCode;


@Controller
@RequestMapping("queryData/")
public class QueryDataController {
         private Result result=new Result(); 
         @Autowired
         private DataCollectionService dataCollectionService;
         @RequestMapping(value ="queryDataList",method=RequestMethod.POST)  
         @ResponseBody      //把回传类转换成json  
     	public ApiResponse<List<DataCollectionModel>> dataList(DataCollectionModel model,HttpServletRequest request,Pager pager)throws ApiException{
     		ApiResponse<List<DataCollectionModel>> response = new  ApiResponse<List<DataCollectionModel>>(ResponseCode.SUCC);      
     		//int num=dataCollectionService.queryCount(model);
     		//pager.setPageSize(num);
     		List<DataCollectionModel> list = dataCollectionService.queryList(model, pager);
      		response.setData(list);	
     		return response;
     	}
 
}
